From b352ab0b9a7417f67257104a1ce2f6e6d61866d7 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Mon, 8 Aug 2005 12:31:04 +0000 Subject: [PATCH] Really fix the x86/64 build. Get rid of push/pop from scale_delta(). Signed-off-by: Keir Fraser --- .../arch/xen/i386/kernel/time.c | 22 +++++++++---------- xen/arch/x86/time.c | 22 +++++++++---------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c index 9925dc9843..6a0fde813c 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c @@ -173,7 +173,7 @@ struct timer_opts timer_tsc = { static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift) { u64 product; - u32 tmp; + u32 tmp1, tmp2; if ( shift < 0 ) delta >>= -shift; @@ -181,17 +181,15 @@ static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift) delta <<= shift; __asm__ ( - "push %%edx ; " - "mul %3 ; " - "pop %%eax ; " - "push %%edx ; " - "mul %3 ; " - "pop %3 ; " - "add %3,%%eax ; " - "xor %3,%3 ; " - "adc %3,%%edx ; " - : "=A" (product), "=r" (tmp) - : "A" (delta), "1" (mul_frac) ); + "mul %5 ; " + "mov %4,%%eax ; " + "mov %%edx,%4 ; " + "mul %5 ; " + "add %4,%%eax ; " + "xor %5,%5 ; " + "adc %5,%%edx ; " + : "=A" (product), "=r" (tmp1), "=r" (tmp2) + : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); return product; } diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 0d13382aba..ade1f2f758 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -103,7 +103,7 @@ static inline u32 mul_frac(u32 multiplicand, u32 multiplier) static inline u64 scale_delta(u64 delta, struct time_scale *scale) { u64 product; - u32 tmp; + u32 tmp1, tmp2; if ( scale->shift < 0 ) delta >>= -scale->shift; @@ -111,17 +111,15 @@ static inline u64 scale_delta(u64 delta, struct time_scale *scale) delta <<= scale->shift; __asm__ ( - "push %%edx ; " - "mul %3 ; " - "pop %%eax ; " - "push %%edx ; " - "mul %3 ; " - "pop %3 ; " - "add %3,%%eax ; " - "xor %3,%3 ; " - "adc %3,%%edx ; " - : "=A" (product), "=r" (tmp) - : "A" (delta), "1" (scale->mul_frac) ); + "mul %5 ; " + "mov %4,%%eax ; " + "mov %%edx,%4 ; " + "mul %5 ; " + "add %4,%%eax ; " + "xor %5,%5 ; " + "adc %5,%%edx ; " + : "=A" (product), "=r" (tmp1), "=r" (tmp2) + : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (scale->mul_frac) ); return product; } -- 2.30.2